package com.example.springboot.mapper;

import com.example.springboot.controller.request.BaseRequset;
import com.example.springboot.entity.Borrow;
import com.example.springboot.entity.Retur;
import com.example.springboot.mapper.po.BorrowReturCountPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BorrowMapper {

    List<Borrow> list();

    List<Borrow> listByCondition(BaseRequset baseRequset);
    List<Retur> listByReturnCondition(BaseRequset baseRequset);

    void save(Borrow obj);
    void saveRetur(Retur obj);

    void updateById(Borrow obj);

    void deleteById(Integer id);

    Borrow getById(Integer id);

    void deleteReturById(Integer id);

    void updateStatus(String status,Integer id);
    List<BorrowReturCountPO> getCountByTimeRange(@Param("timeRange") String timeRange, @Param("type") int type);//1是borrow 2是retur


}
